﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace FFWinMobile
{
    public partial class frmLogin : Form
    {
        public frmLogin()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {

        }

        private void btnLogin_Click(object sender, EventArgs e)
        {
            
            string msg;
            System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
           bool cevap = FF.Login(txtUserName.Text, txtPwd.Text,out msg);
           if (cevap)
           {
               this.DialogResult = DialogResult.OK;
               GF.Giris = true;
               if (cbRememberMe.Checked)
               {
                   GF.UserName = txtUserName.Text;
                   GF.Password = txtPwd.Text;
                   GF.RememberMe = true;
               }
               this.Close();
           }
           else
           {              
               MessageBox.Show(msg);
               this.DialogResult = DialogResult.Cancel;
           }

        }

        private void txtUserName_TextChanged(object sender, EventArgs e)
        {

        }

        private void txtPwd_TextChanged(object sender, EventArgs e)
        {

        }
    }
}